<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
	<link rel="stylesheet" type="text/css" href="../css/main.css" media="screen" />
	<link rel="stylesheet" type="text/css" href="../css/colorbox/colorbox.css" media="screen" />
	<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
	<script type="text/javascript" src="../javascript/jquery.colorbox.js"></script>
 <sx:head/>
</head>
<body>

	<s:if test="(#session.currentPage - 1) > 0">
		<s:url var="previousPage" action="setPageNumber">
			<s:param name="page" value="%{#session.currentPage - 1}"/>
		</s:url>
		<sx:a afterNotifyTopics="searchResultTopic" cssClass="previousPage" href="%{previousPage}">
			<img src="../images/previous.JPG"/>
		</sx:a>
	</s:if>
	
	<s:if test="(#session.currentPage) > 0">
		<s:set name="maxPageNumber" value="maxPage"/>
		<s:if test="(#session.currentPage + 1) <= #maxPageNumber">
			<s:url var="nextPage" action="setPageNumber">
				<s:param name="page" value="%{#session.currentPage + 1}"/>
			</s:url>
			<sx:a afterNotifyTopics="searchResultTopic" cssClass="nextPage" href="%{nextPage}">
				<img src="../images/next.JPG"/>
			</sx:a>
		</s:if>
	</s:if>
	
	<table>
		<s:iterator value="photoBeans" status="photoStatus">
			<s:if test="#photoStatus.index % 4 == 0">
				<tr>
			</s:if>
					<td>
						<s:url var="photoLink" action="photo">
							<s:param name="id"><s:property value ="photoId" /></s:param>
							<s:param name="secret"><s:property value ="photoSecret" /></s:param>
						</s:url>
						<sx:a cssClass="thumbnails" href="%{photoLink}" onclick="%{photoLink}">
							<img src="<s:property value='photoUrlT'/>" />
						</sx:a>
					</td>
			<s:if test="#photoStatus.index % 4 == 3">
				</tr>
			</s:if>
		</s:iterator>
	</table>
	
		<s:if test="(#session.currentPage - 1) > 0">
		<s:url var="previousPage" action="setPageNumber">
			<s:param name="page" value="%{#session.currentPage - 1}"/>
		</s:url>
		<sx:a afterNotifyTopics="searchResultTopic" cssClass="previousPage" href="%{previousPage}">
			<img src="../images/previous.JPG"/>
		</sx:a>
	</s:if>
	
	<s:if test="(#session.currentPage) > 0">
		<s:set name="maxPageNumberBottom" value="maxPage"/>
		<s:if test="(#session.currentPage + 1) <= #maxPageNumberBottom">
			<s:url var="nextPage" action="setPageNumber">
				<s:param name="page" value="%{#session.currentPage + 1}"/>
			</s:url>
			<sx:a afterNotifyTopics="searchResultTopic" cssClass="nextPage" href="%{nextPage}">
				<img src="../images/next.JPG"/>
			</sx:a>
		</s:if>
	</s:if>
</body>
</html>